From e241d15f1c8a8a02baa401af857393f9ada5aeb3 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 13 Aug 2021 16:49:46 +0200 Subject: [PATCH] libxenguest: fix off-by-1 in colo-secondary-bitmap merging Valid GFNs (having a representation in the dirty bitmap) need to be strictly below p2m_size. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- tools/libs/guest/xg_sr_save.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c index 3fce41b6cf..0266e0a94a 100644 --- a/tools/libs/guest/xg_sr_save.c +++ b/tools/libs/guest/xg_sr_save.c @@ -614,7 +614,7 @@ static int colo_merge_secondary_dirty_bitmap(struct xc_sr_context *ctx) for ( i = 0; i < count; i++ ) { pfn = pfns[i]; - if ( pfn > ctx->save.p2m_size ) + if ( pfn >= ctx->save.p2m_size ) { PERROR("Invalid pfn 0x%" PRIx64, pfn); rc = -1; -- 2.30.2